# ObjectLua Demo File 2013 Dhaenens Gert

g_GlobalVar = "Hello World!";

local inspect = require "Scripts/inspect";
if inspect == nil then
	Log.write("Could not load inspect.");
end

local str = inspect(Image);
Log.write(str);
Log.write("");
Log.write("");

Log.write("Lua Script");
Log.write("Dhaenens Gert");
Log.write("----------------");

--local image = Image();
local image = Image("Image1");
image:setWidth(50);
image:setHeight(600);
image.Value = 4.0;

local image2 = Image.Create("Image2", 199, 200);

local image3 = Image("Image3");
image3.Width = 300;
image3.Height = 100;

local image4 = -image2;
local image5 = image2 + image3;
local image6 = image2 - image3;
local image7 = image2 * 4.0;
local image8 = image2 / 2.0;

local strGlobalImage = GlobalImage:getName() .. ": " .. GlobalImage:getWidth() .. "px on " .. GlobalImage:getHeight() .. "px";
local strImage = image:getName() .. ": " .. image:getWidth() .. "px on " .. image:getHeight() .. "px - value: " .. image.Value;
local strImage2 = image2:getName() .. ": " .. image2:getWidth() .. "px on " .. image2:getHeight() .. "px";
local strImage3 = image3:getName() .. ": " .. image3.Width .. "px on " .. image3.Height .. "px";
local strImage4 = image4:getName() .. ": " .. image4.Width .. "px on " .. image4.Height .. "px";
local strImage5 = image5:getName() .. ": " .. image5.Width .. "px on " .. image5.Height .. "px";
local strImage6 = image6:getName() .. ": " .. image6.Width .. "px on " .. image6.Height .. "px";
local strImage7 = image7:getName() .. ": " .. image7.Width .. "px on " .. image7.Height .. "px";
local strImage8 = image8:getName() .. ": " .. image8.Width .. "px on " .. image8.Height .. "px";
local strImageConst = "Max Dimensions: " .. Image.MaxWidth .. "px on " .. Image.MaxHeight .. "px";

Log.write(strGlobalImage);
Log.write(strImage);
Log.write(strImage2);
Log.write(strImage3);
Log.write(strImage4);
Log.write(strImage5);
Log.write(strImage6);
Log.write(strImage7);
Log.write(strImage8);
Log.write(strImageConst);

function GameStart()
	Log.write("This is the game start. How are you doing?");
end

function GetName()
	return "Hello World!";
end

function InspectImage(image)
	Log.write("Lua Image: " .. image:getWidth() .. "px on " .. image:getHeight() .. "px");
end